import {injectReducer} from '../global/reducers'
import reducer from './actions'

// Export default store => ({
//   Path: '/product',
//   GetComponent(nextState, callback) {
//     Require.ensure([], require => {
//       InjectReducer(store, {key: 'product', reducer})
//       Callback(null, App)
//     }, 'product')
//   }
// })

export default (title, store) => ({
  path: '/cart',
  getComponent(nextState, callback) {
    require.ensure([], require => {
      document.title = title
      injectReducer(store, {key: 'cart', reducer})
      callback(null, require('./containers/App'))
    }, 'cart')
  }
})
